export default {
  schemaPath: 'https://localhost:7228/swagger/v1/swagger.json',
  serversPath: './src/swagger',
  requestLibPath: "import request from '@/utils/http'", // 指定自定义请求库
  namespace: 'Api', // 统一类型命名空间
  hook: {
    // 自定义类名和方法名生成规则
    //customClassName: (tagName: any) => `${tagName}Api`,
    customFunctionName: (operation: { operationId: any; }) => {
      const { operationId } = operation;
      if (!operationId) return 'unnamed';

      const cleaned = operationId.replace(/(Controller|Api|Endpoint|Async|Command)/g, '');
      const match = /[A-Z][a-z]+(?:[A-Z][a-zA-Z]*)*$/.exec(cleaned);

      if (match) {
        const word = match[0];
        return word.charAt(0).toLowerCase() + word.slice(1);
      }

      return cleaned.charAt(0).toLowerCase() + cleaned.slice(1);
    }
  }
}